import os
from dotenv import load_dotenv
from pydantic_settings import BaseSettings

ENV = os.getenv("ENV")

if ENV is None:
    ENV = "prod"

# 根据环境加载对应的.env文件
if ENV == "dev":
    load_dotenv(".env.dev", override=True)
else:
    load_dotenv(".env.prod", override=True)

print(f"当前环境: {ENV}")

class Settings(BaseSettings):
    ALAPI_TOKEN: str = os.getenv("ALAPI_TOKEN")
    STATIC_PATH: str = os.getenv("STATIC_PATH")
    STATIC_DIR: str = os.getenv("STATIC_DIR")
    ENV: str = os.getenv("ENV")
    # 其他环境变量...
    
    class Config:
        env_file = f".env.{ENV}"

# 创建设置实例
settings = Settings()